﻿<%@ Application Language="C#" %>

<script runat="server">

    void Application_Start(object sender, EventArgs e) 
    {
        // Code that runs on application startup
        log4net.Config.XmlConfigurator.Configure();

    }
    
    void Application_End(object sender, EventArgs e) 
    {
        //  Code that runs on application shutdown

    }
        
    void Application_Error(object sender, EventArgs e) 
    { 
        // Code that runs when an unhandled error occurs

    }

    void Session_Start(object sender, EventArgs e) 
    {
        // Code that runs when a new session is started

       // HttpContext.Current.Session["User"] = "abc@yahoo.com";
        System.Data.DataTable datalist = new System.Data.DataTable();
        datalist.Rows.Clear();
        datalist.Columns.Clear();
        datalist.Columns.Add("Masp", typeof(string));
        datalist.Columns.Add("TenSp", typeof(string));
        datalist.Columns.Add("SoLuong", typeof(int));
        datalist.Columns.Add("DONGIA", typeof(int));
        datalist.Columns.Add("TONGGIA", typeof(int));
        datalist.Columns.Add("CONLAI", typeof(int));

        HttpContext.Current.Session["GioHang"] = datalist;
     //  HttpContext.Current.Session["GioHang"] = new System.Data.DataTable();
        HttpContext.Current.Session["User"] = null;
       HttpContext.Current.Session["Gia"] = 0;
     //   DevNET.Shopping.Cart gh = new DevNET.Shopping.Cart((System.Data.DataTable)Session["GioHang"]);
        //gh.TaoGioHang();

    }

    void Session_End(object sender, EventArgs e) 
    {
      //  ((System.Data.DataTable)HttpContext.Current.Session["GioHang"]).Clear();
        HttpContext.Current.Session["GioHang"] = null;
        HttpContext.Current.Session["Gia"] = 0;
        HttpContext.Current.Session["User"] = null;
    }
       
</script>
